﻿#ifndef _OI_PLSCANNERCORE_SETTINGDLG_HPP_
#define _OI_PLSCANNERCORE_SETTINGDLG_HPP_

#include "PLScannerCore/OiPLScannerCore.hpp"
#include "Ctrl/OiDialog.hpp"

namespace Oi
{
    namespace PLScannerCore
    {
        class OI_PLSCANNER_CORE_API SettingsDlg : public Ctrl::Dialog
        {
            Q_OBJECT
        public:
            enum SettingMode
            {
                GLOBAL,
                LOCAL,
            };

        public:
            SettingsDlg(QWidget* parent = nullptr, SettingMode mode = GLOBAL);

        public:
            void saveParams();

        public:
            void setLocalConfig(const QVariantMap);
            QVariantMap localConfig() const;

        public slots:
            void accept();
            void onDirChoose();
            void onSwitchModeChanged();

        public:
            static QVariantMap config();
            static void setConfig(const QVariantMap);

        private:
            OI_DISABLE_COPY(SettingsDlg);
            OI_DECLARE_IMPL(SettingsDlg);
        };
    }
}

#endif
